import { ComponentResolver } from 'unplugin-vue-components'

function YKResolver (): ComponentResolver[] {
  return [
    // 因WebStorm无法识别自动引入的组件，暂取消自动引入组件
    // {
    //   type: 'component',
    //   resolve: (name) => {
    //     if (name.startsWith('Yk')) {
    //       return { name, from: '@/@yk' }
    //     }
    //   }
    // },
    {
      type: 'directive',
      resolve: async (name) => {
        return { name, from: '@/@yk' }
      }
    }
  ]
}

export default YKResolver
